package com.telchina.common.enums;

import cn.hutool.core.util.ArrayUtil;

/**
 * 流程实例流转状态枚举
 */
public enum ApproveStatusEnum {
    /**
     * 草稿（新单据）
     */
    DRAFT("0", "草稿"),
    /**
     * 审核中
     */
    IN_APPROVAL("1", "审核中"),
    /**
     * 审核完成
     */
    COMPLETED("2", "审核完成");


    private final String code;
    private final String info;

    public static ApproveStatusEnum getValueOf(String value) {
        return ArrayUtil.firstMatch(worderOrderStatus -> worderOrderStatus.getCode().equals(value), ApproveStatusEnum.values());
    }

    private ApproveStatusEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return this.code;
    }

    public String getInfo() {
        return this.info;
    }
}